package net.stevechaloner.idea.ffs.actions;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.project.Project;
import net.stevechaloner.idea.ffs.model.src.Search;
import net.stevechaloner.idea.ffs.model.xml.SearchPlugin;
import org.jetbrains.annotations.NotNull;

/**
 * Factory for search actions.
 * @author Steve Chaloner
 */
public class SearchActionFactory
{
    /**
     * Static access only.
     */
    private SearchActionFactory(){}

    /**
     * Creates a search action.
     *
     * @param project the project
     * @param search the search provider
     * @return the search action
     */
    public static AnAction createAction(@NotNull Project project,
                                        @NotNull Search search)
    {
        return new FirefoxSearchAction(project,
                                       search);
    }

    /**
     * Creates a search action.
     *
     * @param project the project
     * @param searchPlugin the search provider
     * @return the search action
     */
    public static AnAction createAction(@NotNull Project project,
                                        @NotNull SearchPlugin searchPlugin)
    {
        return new FirefoxSearchPluginAction(project,
                                             searchPlugin);
    }
}
